SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 51642: Using a negative array subscript might generate the error "Array subscript out of range"

DetailsHotfixAboutRate It

Error messages similar to the following can be generated when you use a variable that has a negative value as an array subscript:

ERROR: Array subscript out of range at line 4 column 5.
NOTE: The SAS System stopped processing this step because of errors.

The error can occur even if the subscript value is valid.

The example code below results in an incorrect error message:

data _null_;
   array pm[-7:0] (1, 1, 1, 1, 1, 1, 1, 1);
   i=-1;
   x = pm[i];
run;

Click the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASMicrosoft® Windows® for x649.3_M29.49.3 TS1M29.4 TS1M0
Microsoft Windows 8 Enterprise x649.3_M29.49.3 TS1M29.4 TS1M0
Microsoft Windows 8 Pro x649.3_M29.49.3 TS1M29.4 TS1M0
Microsoft Windows 8.1 Enterprise x649.3_M29.49.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 for x649.3_M29.3 TS1M2
Microsoft Windows Server 2008 for x649.3_M29.49.3 TS1M29.4 TS1M0
Windows 7 Enterprise x649.3_M29.49.3 TS1M29.4 TS1M0
Windows 7 Home Premium x649.3_M29.3 TS1M2
Windows 7 Professional x649.3_M29.49.3 TS1M29.4 TS1M0
Windows 7 Ultimate x649.3_M29.3 TS1M2
Windows Vista for x649.3_M29.3 TS1M2
Linux for x649.3_M29.49.3 TS1M29.4 TS1M0
Solaris for x649.3_M29.49.3 TS1M29.4 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.